<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var Digis = function (num) {
      if (num == 0) return 1
      if (num == 1) return 10
      let res = 10, cur = 9
      for (let i = 0; i < num - 1; i++) {
        cur *= 9 - i
        res += cur
      }
      return res
    }
    console.log(Digis(2))

  </script>
</body>

</html>